package tedu.api.io;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class PWDemo {
    public static void main(String[] args) throws IOException {
        /*PrintWriter pw = new PrintWriter("pw.txt");
        pw.println("读书不觉已春深，一寸光阴一寸金。");
        pw.println("侯门一入深似海，从此萧郎是路人。");
        pw.close();*/


        FileOutputStream fos = new FileOutputStream("pw.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        BufferedWriter bw = new BufferedWriter(osw);
        PrintWriter pw = new PrintWriter(bw);
        pw.println("一曲一箫一世界,一诗一赋一人生");
        pw.println("不言永久如天地,只愿相依似侣鸯。");
        pw.close();
        /*bw.write("一曲一箫一世界,一诗一赋一人生");
        bw.write("不言永久如天地,只愿相依似侣鸯。");
        bw.close();
        */
        System.out.println("写出完成");

    }
}
